﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace VolunteerWebsite.Models
{

    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Current password")]
        public string OldPassword { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "New password")]
        public string NewPassword { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "Confirm new password")]
        [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required]
        [Display(Name = "帐号")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [Display(Name = "记住帐号")]
        public bool RememberAccount { get; set; }

        [Display(Name = "记住密码")]
        public bool RememberPassword { get; set; }
    }

    public class RegisterModel
    {
        /**************** 账户信息******************/
        [Required]
        [Display(Name = "用户名(学号)")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "E-mail")]
        public string Email { get; set; }

        [Required]
        [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
        public string ConfirmPassword { get; set; }

        /**************** 用户信息******************/
        [Required]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "性别")]
        public string Gender { get; set; }

        [Required]
        [Display(Name = "年级")]
        public string Grade { get; set; }

        [Required]
        [Display(Name = "学院")]
        public string School { get; set; }

        [Required]
        [DataType(DataType.PhoneNumber)]
        [Display(Name = "手机")]
        public string PhoneNumber { get; set; }

        [Required]
        [Display(Name = "身份证")]
        public string IdentityNumber { get; set; }

        [Required]
        [Display(Name = "校内住址")]
        public string LivingAddress { get; set; }

        [Required]
        [Display(Name = "验证问题")]
        public string SecurityQuestion { get; set; }

        [Required]
        [Display(Name = "验证答案")]
        public string SecurityAnswer { get; set; }
    }
}
